/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.au.uq.datamining.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author oracle
 */
@Entity
@Table(name = "TPERSONAID", catalog = "", schema = "FITINT")
@NamedQueries({
    @NamedQuery(name = "Tpersonaid.findAll", query = "SELECT t FROM Tpersonaid t"),
    @NamedQuery(name = "Tpersonaid.findByCpersona", query = "SELECT t FROM Tpersonaid t WHERE t.cpersona = :cpersona")})
public class Tpersonaid implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CPERSONA", nullable = false)
    private Integer cpersona;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tpersonaid", fetch = FetchType.LAZY)
    private List<BasicInfo> basicInfoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tpersonaid", fetch = FetchType.LAZY)
    private List<AdditionalInfo> additionalInfoList;

    public Tpersonaid() {
    }

    public Tpersonaid(Integer cpersona) {
        this.cpersona = cpersona;
    }

    public Integer getCpersona() {
        return cpersona;
    }

    public void setCpersona(Integer cpersona) {
        this.cpersona = cpersona;
    }

    public List<BasicInfo> getBasicInfoList() {
        return basicInfoList;
    }

    public void setBasicInfoList(List<BasicInfo> basicInfoList) {
        this.basicInfoList = basicInfoList;
    }

    public List<AdditionalInfo> getAdditionalInfoList() {
        return additionalInfoList;
    }

    public void setAdditionalInfoList(List<AdditionalInfo> additionalInfoList) {
        this.additionalInfoList = additionalInfoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cpersona != null ? cpersona.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tpersonaid)) {
            return false;
        }
        Tpersonaid other = (Tpersonaid) object;
        if ((this.cpersona == null && other.cpersona != null) || (this.cpersona != null && !this.cpersona.equals(other.cpersona))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.au.uq.datamining.entity.Tpersonaid[cpersona=" + cpersona + "]";
    }

}
